home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
DB_CLIPP
/
0264.ZIP
/
CHKBK.ARC
/
SUBROUTE.PRG
< prev
Wrap
Text File
|
1985-07-27
|
8KB
|
421 lines
****************
PROCEDURE DEPSIT
****************
SET COLOR TO 2+/1,6+/4,1
STORE " " TO CONT
CLEAR GETS
@24,10 SAY "Do you want to enter new deposits? (Y/N) " GET CONT
READ
IF UPPER(CONT)<>"Y"
RETURN
ENDIF
SELECT 2
USE DEPOSITS INDEX DATE,AMOUNT
SET FORM TO DEP
DO WHILE .T.
APPEND blank
EDIT RECNO()
@23,0 CLEAR
WAIT SPACE(29)+"ENTER ANOTHER (Y/N)? " TO MORE
IF UPPER(MORE) = "Y"
SKIP -1
STORE BALANCE+AMOUNT TO BALANCE
LOOP
ELSE
CLEAR
SKIP -1
STORE BALANCE+AMOUNT TO BALANCE
CLOSE FORM
SELECT 1
RETURN
ENDIF
ENDDO
******************
PROCEDURE CHECKREG
******************
SET COLOR TO 3+/1,6+/4,1
STORE " " TO CONT
STORE DATE() TO MDATE
STORE 0 TO MCKNUM
CLEAR GETS
@24,10 SAY "Do you want to enter new checks? (Y/N) " GET CONT
READ
IF UPPER(CONT)<>"Y"
RETURN
ENDIF
SELECT 1
USE CHECKS INDEX CKNUM
SET FORM TO CHECK
DO WHILE .T.
APPEND blank
REPLACE DATE WITH MDATE,CHKNUM WITH MCKNUM+1
EDIT RECNO()
@23,0 CLEAR
WAIT SPACE(29)+"ENTER ANOTHER (Y/N)? " TO MORE
IF UPPER(MORE) = "Y"
SKIP -1
STORE BALANCE-AMOUNT TO BALANCE
STORE DATE TO MDATE
STORE CHKNUM TO MCKNUM
LOOP
ELSE
CLEAR
SKIP -1
STORE BALANCE-AMOUNT TO BALANCE
CLOSE FORM
RETURN
ENDIF
ENDDO
******************
PROCEDURE STATEMNT
******************
SET COLOR TO 6+/1,6+/4,1
SELECT 1
USE CHECKS INDEX CKNUM
SELECT 2
USE DEPOSITS INDEX AMOUNT,DATE
STORE "N" TO CONT
STORE "N" TO CORRECT
CLEAR GETS
@24,10 SAY "Do you want to balance your statement? (Y/N) " GET CONT
READ
IF UPPER(CONT)<>"Y"
RETURN
ENDIF
CLEAR
CLEAR GETS
STORE "N" TO CONT
@10,10 SAY "Do you want to clear checks? (Y/N) " GET CONT
READ
IF UPPER(CONT)<>"Y"
DO STATE2
RETURN
ENDIF
SELECT 1
SET FORM TO CHECK
SET FILTER TO .NOT.CLEARED
GO TOP
DO WHILE .T.
CLEAR
@10,0 SAY ""
INPUT "Enter check number: " TO NUM
SEEK NUM
IF EOF()=.T.
? CHR(07)
@12,0 SAY "Sorry, that check number does not exist or was already cleared!"
WAIT "Type 'Q' to Quit, any other key to try again. " TO AGAIN
IF UPPER(AGAIN)="Q"
CLEAR
EXIT
ENDIF
@12,0 CLEAR
GO TOP
LOOP
ELSE
REPLACE CLEARED WITH .T.
@12,0 SAY ""
STORE "N" TO MORE
WAIT "More checks to clear? (Y/N) " TO MORE
IF UPPER(MORE) = "Y"
CLEAR
LOOP
ELSE
CLEAR
CLOSE FORM
DO STATE2
RETURN
ENDIF
ENDIF
ENDDO
CLEAR
CLOSE FORM
DO STATE2
****************
PROCEDURE STATE2
****************
CLEAR GETS
STORE "N" TO CONT
@10,10 SAY "Do you want to clear deposits? (Y/N) " GET CONT
READ
IF UPPER(CONT)<>"Y"
DO STATE3
RETURN
ENDIF
SELECT 2
SET FILTER TO .NOT. CLEARED
GO TOP
CLEAR
DO WHILE .T.
@10,0 SAY ""
INPUT "Enter deposit amount: " TO DEPAMNT
SEEK DEPAMNT
IF EOF()
? CHR(07)
@12,0 SAY "Sorry, that deposit does not exist or was already cleared!"
WAIT "Type 'Q' to Quit, any other key to try again. " TO AGAIN
IF UPPER(AGAIN)="Q"
CLEAR
EXIT
ENDIF
@12,0 CLEAR
GO TOP
LOOP
ELSE
CLEAR
DO BOX2
@5,27 say "Date of deposit:"
@5,43 SAY date
@7,7 say "Source of funds:"
@7,22 SAY source
@9,30 say "Amount: $"
@9,39 SAY amount picture "###,###.##"
@13,32 say "Correct deposit (Y/N)?"
@13,55 get correct
READ
IF UPPER(CORRECT)="Y"
REPLACE CLEARED WITH .T.
@12,0 SAY ""
ENDIF
CLEAR
WAIT "More deposits to clear? (Y/N) " TO MORE
IF UPPER(MORE) = "Y"
CLEAR
LOOP
ELSE
CLEAR
CLOSE FORM
DO STATE3
RETURN
ENDIF
ENDIF
ENDDO
CLEAR
CLOSE FORM
DO STATE3
****************
PROCEDURE STATE3
****************
SELECT 1
SUM ALL AMOUNT TO OUTCHK FOR .NOT. CLEARED
SET FILTER TO .NOT.CLEARED
SELECT 2
SUM ALL AMOUNT TO OUTDEP FOR .NOT. CLEARED
SET FILTER TO .NOT.CLEARED
SET INDEX TO DATE,AMOUNT
CLEAR
DO WHILE .T.
STORE 0 TO ANS
DO BOX1
@4,20 SAY "1) List Outstanding checks"
@5,20 SAY "2) List Outstanding deposits"
@9,10 SAY "TOTAL OF OUTSTANDING CHECKS: $"
@9,40 SAY OUTCHK PICTURE "@B( #,###,###.##"
@11,10 SAY "TOTAL OF OUTSTANDING DEPOSITS: $"
@11,42 SAY OUTDEP PICTURE "@B( #,###,###.##"
@13,10 SAY "STATEMENT BALANCE SHOULD BE: $"
@13,40 SAY BALANCE+OUTCHK-OUTDEP PICTURE "@B( #,###,###.##"
@15,10 SAY "ENTER 1 or 2 (any other key to quit): " GET ANS PICTURE "#"
READ
DO CASE
CASE ANS=1
CLEAR
SELECT 1
DISPLAY ALL OFF DATE,CHKNUM,PAYEE,AMOUNT
WAIT
CLEAR
CASE ANS=2
CLEAR
SELECT 2
DISPLAY ALL OFF DATE,SOURCE,AMOUNT
WAIT
CLEAR
OTHERWISE
CLEAR
RETURN
ENDCASE
ENDDO
***************
PROCEDURE PRINT
***************
STORE "S" TO WHERE
SET COLOR TO 4+/1,6+/4,1
SELECT 1
USE CHECKS INDEX CKNUM
SELECT 2
USE DEPOSITS INDEX DATE,AMOUNT
DO WHILE .T.
CLEAR
STORE 0 TO ANS
DO BOX1
@4,30 SAY "Electronic Checkbook"
@5,33 SAY "Summary Reports"
@9,25 SAY "1) Report by Payee"
@11,25 SAY "2) Report by Purpose"
@13,25 SAY "3) Report of Outstanding Checks"
@15,25 SAY "4) Report of Outstanding Deposits"
@17,25 SAY "5) Quit"
@19,25 SAY "Enter your selection: " GET ANS PICTURE "#"
READ
IF ANS <> 5
CLEAR GETS
CLEAR
@12,10 SAY "Do you want run this report to the screen or the print? (S/P) " GET WHERE
READ
IF UPPER(WHERE)="P"
STORE "TO PRINT" TO SWITCH
ELSE
STORE "" TO SWITCH
ENDIF
ENDIF
DO CASE
CASE ANS=1
SELECT 1
STORE SPACE(20) TO VPAY
CLEAR
@10,10 SAY "Enter Payee: " GET VPAY
READ
CLEAR
REPORT FORM CHKS &SWITCH FOR PAYEE=VPAY HEADING "Checks Listed by Payee"
IF UPPER(WHERE)="S"
WAIT
ENDIF
CLEAR
LOOP
CASE ANS=2
SELECT 1
STORE SPACE(20) TO VPURP
CLEAR
@10,10 SAY "Enter Purpose: " GET VPURP
READ
CLEAR
REPORT FORM CHKS &SWITCH FOR PURPOSE=VPURP HEADING "Checks Listed by Purpose"
IF UPPER(WHERE)="S"
WAIT
ENDIF
CLEAR
LOOP
CASE ANS=3
SELECT 1
CLEAR
REPORT FORM CHKS &SWITCH FOR .NOT.CLEARED HEADING "Outstanding Checks"
IF UPPER(WHERE)="S"
WAIT
ENDIF
CLEAR
LOOP
CASE ANS=4
SELECT 2
CLEAR
REPORT FORM DEPS &SWITCH FOR .NOT.CLEARED HEADING "Outstanding Deposits"
IF UPPER(WHERE)="S"
WAIT
ENDIF
CLEAR
LOOP
CASE ANS=5
CLEAR
RETURN
ENDCASE
ENDDO
**************
PROCEDURE BOX1
**************
PUBLIC FLAG
STORE .T. TO FLAG
DO BOX
RETURN
**************
PROCEDURE BOX2
**************
PUBLIC FLAG
STORE .F. TO FLAG
DO BOX
RETURN
*************
PROCEDURE BOX
*************
@2,5 say lcorner+double+rcorner
@2,30 say "Balance: $"
IF BALANCE < 0
SET COLOR TO 4+*/1
ENDIF
@2,40 say balance picture "@B( #,###,###.##"
SET COLOR TO 2/1
@3,5 say vedge
@3,75 say vedge
@4,5 say vedge
@4,75 say vedge
@5,5 say vedge
@5,75 say vedge
@6,5say vedge
@6,75 say vedge
IF FLAG
@7,5 say left+double+right
ELSE
@7,5 say vedge
@7,75 say vedge
ENDIF
@8,5 say vedge
@8,75 say vedge
@9,5 say vedge
@9,75 say vedge
@10,5 say vedge
@10,75 say vedge
IF FLAG
@11,5 say vedge
@11,75 say vedge
@12,5 say vedge
@12,75 say vedge
@13,5 say vedge
@13,75 say vedge
@14,5 say vedge
@14,75 say vedge
@15,5 say vedge
@15,75 say vedge
@16,5 say vedge
@16,75 say vedge
@17,5 say vedge
@17,75 say vedge
@18,5 say vedge
@18,75 say vedge
@19,5 say vedge
@19,75 say vedge
@20,5 say vedge
@20,75 say vedge
@21,5 say lowerl+double+lowerr
ELSE
@11,5 say lowerl+double+lowerr
ENDIF
RETURN